package com.zkthink.ceres.common.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

/**
 * @ClassName VehicleTypeEnum
 * @Description: VehicleTypeEnum
 * @Author ck
 * @Date 2021/11/12
 * @Version V1.0
 **/
@Getter
public enum VehicleTypeEnum {
    BX_VEHICLE(0, "不限"),
    JC_VEHICLE(1, "轿车"),
    YYC_VEHICLE(2, "越野车"),
    SWC_VEHICLE(3, "商务车"),
    MMC_VEHICLE(4, "面包车"),
    MTC_VEHICLE(5, "摩托车"),
    NO_VEHICLE(6, "无车");

    private int code;

    private String desc;

    VehicleTypeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static VehicleTypeEnum getDscByType(Integer type) {
        for (VehicleTypeEnum p : values()) {
            if (p.getCode() == type.intValue()) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }
}